package com.hsc.www.tk;

import com.sun.beans.TypeResolver;
import lombok.Getter;
import lombok.Setter;
import org.junit.Test;
import org.springframework.util.ReflectionUtils;
import tk.mybatis.mapper.mapperhelper.FieldHelper;

import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Hello world!
 */
public class App11111 {
    @Test
    public void name() {
    }

    public static void main(String[] args) throws Exception {
       Object o = FieldHelper.getAll(B.class);
//        SerializeConfig s=new   SerializeConfig(1,true);
////        JSONObject.toJSONString(new B(),s);

        BeanInfo u = Introspector.getBeanInfo(C.class);
        PropertyDescriptor[] s = u.getPropertyDescriptors();
        s[0].getPropertyType();


        for (Method method : C.class.getMethods()) {

            if (ReflectionUtils.isObjectMethod(method)) {
              return;
            }


            Object s111 = TypeResolver.erase(TypeResolver.resolveInClass(C.class, method.getParameterTypes()));
            System.out.println("dd");

        }


    }

    public static List<Field> getFields(Class clazz) {
        List<Field> fields = new ArrayList<>();
        while (clazz != Object.class) {
            fields.addAll(Arrays.asList(clazz.getDeclaredFields()));
            clazz = clazz.getSuperclass();
        }
        return fields;
    }
}

class A<T> {
    T a4;
    T a5;

    public void setA4(T a4) {
        this.a4 = a4;
    }

    public T getA5() {
        return a5;
    }
}

@Getter
@Setter
class B<T> extends A<T> {

}

class C extends B<Integer> {


}
